package com.filetransfer.view.Components;
import com.filetransfer.utils.SvgIconUtil;
import com.filetransfer.viewmodel.base.TaskTableModel;
import com.filetransfer.viewmodel.base.TaskTableRowModel;
import com.formdev.flatlaf.extras.FlatSVGIcon;

import javax.swing.*;
import javax.swing.text.*;
import java.awt.*;

public class MarkdownPanel {
    public JScrollPane createMarkdownPanel() {
        // Main Panel
        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));

        // Main Scroll Pane
        JScrollPane mainScrollPane = new JScrollPane(mainPanel);
        mainScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
        mainScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        mainScrollPane.getVerticalScrollBar().setUnitIncrement(16);

        // Paragraph 1  Heading
        String heading1Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading1Label = new JLabel(String.format(heading1Html, 420, "文件传输助手客户端项目"));
        heading1Label.setFont(heading1Label.getFont().deriveFont(20.0f));heading1Label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        heading1Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading1Label);

// Paragraph 2  HorizontalRule
        String horizontalRule2Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel horizontalRule2 = new JLabel(String.format(horizontalRule2Html, 400, ""));horizontalRule2.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        horizontalRule2.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(horizontalRule2);

// Paragraph 3  Heading
        String heading3Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading3Label = new JLabel(String.format(heading3Html, 420, "项目概述"));
        heading3Label.setFont(heading3Label.getFont().deriveFont(24.0f));heading3Label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        heading3Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading3Label);

// Paragraph 4  List
        JPanel list4Panel = new JPanel();
        list4Panel.setLayout(new BoxLayout(list4Panel, BoxLayout.Y_AXIS));

        JLabel list4Label1 = new JLabel("•  文件传输助手客户端使用 Java Swing 和 FlatLaf 框架进行用户界面开发");
        list4Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list4Panel.add(list4Label1);
        JLabel list4Label2 = new JLabel("•  提供简洁美观的桌面应用。用户可以通过图形界面上传文件、下载文件、查看留言消息以及获取文件统计信息");
        list4Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list4Panel.add(list4Label2);
        JLabel list4Label3 = new JLabel("•  项目通过 Maven 进行依赖管理");
        list4Label3.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list4Panel.add(list4Label3);

        list4Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list4Panel);

// Paragraph 5  HorizontalRule
        String horizontalRule5Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel horizontalRule5 = new JLabel(String.format(horizontalRule5Html, 400, ""));horizontalRule5.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        horizontalRule5.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(horizontalRule5);

// Paragraph 6  Heading
        String heading6Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading6Label = new JLabel(String.format(heading6Html, 420, "技术栈"));
        heading6Label.setFont(heading6Label.getFont().deriveFont(24.0f));heading6Label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        heading6Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading6Label);

// Paragraph 7  List
        JPanel list7Panel = new JPanel();
        list7Panel.setLayout(new BoxLayout(list7Panel, BoxLayout.Y_AXIS));

        JLabel list7Label1 = new JLabel("•  UI 框架：Java Swing");
        list7Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list7Panel.add(list7Label1);
        JLabel list7Label2 = new JLabel("•  主题库：FlatLaf（轻量级现代化外观主题）");
        list7Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list7Panel.add(list7Label2);
        JLabel list7Label3 = new JLabel("•  项目管理工具：Maven");
        list7Label3.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list7Panel.add(list7Label3);
        JLabel list7Label4 = new JLabel("•  开发工具：推荐 IntelliJ IDEA");
        list7Label4.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list7Panel.add(list7Label4);

        list7Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list7Panel);

// Paragraph 8  HorizontalRule
        String horizontalRule8Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel horizontalRule8 = new JLabel(String.format(horizontalRule8Html, 400, ""));horizontalRule8.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        horizontalRule8.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(horizontalRule8);

// Paragraph 9  Heading
        String heading9Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading9Label = new JLabel(String.format(heading9Html, 420, "功能特性"));
        heading9Label.setFont(heading9Label.getFont().deriveFont(24.0f));heading9Label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        heading9Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading9Label);

// Paragraph 10  List
        JPanel list10Panel = new JPanel();
        list10Panel.setLayout(new BoxLayout(list10Panel, BoxLayout.Y_AXIS));

        JLabel list10Label1 = new JLabel("1. 文件上传");
        list10Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list10Panel.add(list10Label1);
        JLabel list10Label2 = new JLabel("      用户可以通过图形界面选择文件上传到服务器。");
        list10Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list10Panel.add(list10Label2);
        JLabel list10Label3 = new JLabel("      上传成功后，返回文件验证码。");
        list10Label3.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list10Panel.add(list10Label3);

        list10Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list10Panel);

// Paragraph 11  List
        JPanel list11Panel = new JPanel();
        list11Panel.setLayout(new BoxLayout(list11Panel, BoxLayout.Y_AXIS));

        JLabel list11Label1 = new JLabel("2. 文件下载");
        list11Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list11Panel.add(list11Label1);
        JLabel list11Label2 = new JLabel("      用户输入文件验证码，系统验证后提供文件下载功能。");
        list11Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list11Panel.add(list11Label2);

        list11Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list11Panel);

// Paragraph 12  List
        JPanel list12Panel = new JPanel();
        list12Panel.setLayout(new BoxLayout(list12Panel, BoxLayout.Y_AXIS));

        JLabel list12Label1 = new JLabel("3. 留言管理");
        list12Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list12Panel.add(list12Label1);
        JLabel list12Label2 = new JLabel("      用户可以查看与文件关联的留言信息。");
        list12Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list12Panel.add(list12Label2);
        JLabel list12Label3 = new JLabel("      支持用户针对文件添加留言。");
        list12Label3.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list12Panel.add(list12Label3);

        list12Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list12Panel);

// Paragraph 13  List
        JPanel list13Panel = new JPanel();
        list13Panel.setLayout(new BoxLayout(list13Panel, BoxLayout.Y_AXIS));

        JLabel list13Label1 = new JLabel("4. 文件统计");
        list13Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list13Panel.add(list13Label1);
        JLabel list13Label2 = new JLabel("     向用户展示有关不同类型文件上传下载的统计信息。");
        list13Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list13Panel.add(list13Label2);

        list13Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list13Panel);

// Paragraph 14  List
        JPanel list14Panel = new JPanel();
        list14Panel.setLayout(new BoxLayout(list14Panel, BoxLayout.Y_AXIS));

        JLabel list14Label1 = new JLabel("5. 界面美观");
        list14Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list14Panel.add(list14Label1);
        JLabel list14Label2 = new JLabel("      采用 FlatLaf 主题库，提供现代化的界面风格。");
        list14Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list14Panel.add(list14Label2);
        JLabel list14Label3 = new JLabel("      可以进行主题更换，自行导入主题。");
        list14Label3.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list14Panel.add(list14Label3);

        list14Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list14Panel);

// Paragraph 15  Heading
        String heading15Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading15Label = new JLabel(String.format(heading15Html, 420, "环境配置"));
        heading15Label.setFont(heading15Label.getFont().deriveFont(24.0f));heading15Label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        heading15Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading15Label);

// Paragraph 16  Heading
        String heading16Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading16Label = new JLabel(String.format(heading16Html, 420, "1. 环境要求"));
        heading16Label.setFont(heading16Label.getFont().deriveFont(20.0f));heading16Label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        heading16Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading16Label);

// Paragraph 17  List
        JPanel list17Panel = new JPanel();
        list17Panel.setLayout(new BoxLayout(list17Panel, BoxLayout.Y_AXIS));

        JLabel list17Label1 = new JLabel("•  JDK：推荐使用 JDK 17 或以上");
        list17Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list17Panel.add(list17Label1);
        JLabel list17Label2 = new JLabel("•  Maven：3.6.0 或更高版本");
        list17Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list17Panel.add(list17Label2);
        JLabel list17Label3 = new JLabel("•  开发工具：推荐 IntelliJ IDEA 或 Eclipse");
        list17Label3.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list17Panel.add(list17Label3);

        list17Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list17Panel);

// Paragraph 18  Heading
        String heading18Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading18Label = new JLabel(String.format(heading18Html, 420, "2. 克隆项目"));
        heading18Label.setFont(heading18Label.getFont().deriveFont(20.0f));heading18Label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        heading18Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading18Label);

// Paragraph 19  Code
        JTextArea codeBlock19TextArea = new JTextArea("git clone https://gitcode.com/file_transfer/file_transfer_java_ui.git \ncd file_transfer ");
        codeBlock19TextArea.setFont(new Font("Monospaced", Font.PLAIN, 12));
        codeBlock19TextArea.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        JScrollPane codeBlock19ScrollPane = new JScrollPane(codeBlock19TextArea);
        codeBlock19ScrollPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        codeBlock19ScrollPane.setPreferredSize(new Dimension(300, 100));

        codeBlock19ScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(codeBlock19ScrollPane);

// Paragraph 20  Heading
        String heading20Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading20Label = new JLabel(String.format(heading20Html, 420, "3. 配置 Maven"));
        heading20Label.setFont(heading20Label.getFont().deriveFont(20.0f));heading20Label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        heading20Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading20Label);

// Paragraph 21  Paragraph
        JTextPane paragraph21 = new JTextPane();
        paragraph21.setContentType("text/html");
        paragraph21.setEditable(false);
        StyledDocument paragraph21Doc = paragraph21.getStyledDocument();
        paragraph21.setMargin(new Insets(10, 10, 10, 10));

        Style regular21 = paragraph21Doc.addStyle("regular", null);
        StyleConstants.setFontFamily(regular21, "SansSerif");

        try {
            paragraph21Doc.insertString(paragraph21Doc.getLength(), "确保 Maven 可以正常运行：", regular21);
        } catch (BadLocationException e) {
            e.printStackTrace();
        }

        paragraph21.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(paragraph21);

// Paragraph 22  Code
        JTextArea codeBlock22TextArea = new JTextArea("mvn version ");
        codeBlock22TextArea.setFont(new Font("Monospaced", Font.PLAIN, 12));
        codeBlock22TextArea.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        JScrollPane codeBlock22ScrollPane = new JScrollPane(codeBlock22TextArea);
        codeBlock22ScrollPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        codeBlock22ScrollPane.setPreferredSize(new Dimension(300, 80));

        codeBlock22ScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(codeBlock22ScrollPane);

// Paragraph 23  HorizontalRule
        String horizontalRule23Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel horizontalRule23 = new JLabel(String.format(horizontalRule23Html, 400, ""));horizontalRule23.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        horizontalRule23.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(horizontalRule23);

// Paragraph 24  Heading
        String heading24Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading24Label = new JLabel(String.format(heading24Html, 420, "项目依赖"));
        heading24Label.setFont(heading24Label.getFont().deriveFont(24.0f));heading24Label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        heading24Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading24Label);

// Paragraph 25  Paragraph
        JTextPane paragraph25 = new JTextPane();
        paragraph25.setContentType("text/html");
        paragraph25.setEditable(false);
        StyledDocument paragraph25Doc = paragraph25.getStyledDocument();
        paragraph25.setMargin(new Insets(10, 10, 10, 10));

        Style regular25 = paragraph25Doc.addStyle("regular", null);
        StyleConstants.setFontFamily(regular25, "SansSerif");
        Style code25 = paragraph25Doc.addStyle("code", regular25);
        StyleConstants.setFontFamily(code25, "Monospaced");

        try {
            paragraph25Doc.insertString(paragraph25Doc.getLength(), "项目依赖通过 ", regular25);
            paragraph25Doc.insertString(paragraph25Doc.getLength(), "pom.xml", code25);
            paragraph25Doc.insertString(paragraph25Doc.getLength(), " 进行管理，主要依赖如下：", regular25);
        } catch (BadLocationException e) {
            e.printStackTrace();
        }

        paragraph25.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(paragraph25);

// Paragraph 26  Code
        JTextArea codeBlock26TextArea = new JTextArea("<dependencies>\n    <! Swing FlatLaf 主题库 >\n    <dependency>\n        <groupId>com.formdev</groupId>\n        <artifactId>flatlaf</artifactId>\n        <version>3.2</version>\n    </dependency>");
        codeBlock26TextArea.setFont(new Font("Monospaced", Font.PLAIN, 12));
        codeBlock26TextArea.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        JScrollPane codeBlock26ScrollPane = new JScrollPane(codeBlock26TextArea);
        codeBlock26ScrollPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        codeBlock26ScrollPane.setPreferredSize(new Dimension(300, 150));

        codeBlock26ScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(codeBlock26ScrollPane);

// Paragraph 27  Code
        JTextArea codeBlock27TextArea = new JTextArea("<! HTTP 客户端库，用于与后端交互 >\n<dependency>\n    <groupId>org.apache.httpcomponents</groupId>\n    <artifactId>httpclient</artifactId>\n    <version>4.5.13</version>\n</dependency>\n...\n</dependencies>\n```  ");
        codeBlock27TextArea.setFont(new Font("Monospaced", Font.PLAIN, 12));
        codeBlock27TextArea.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        JScrollPane codeBlock27ScrollPane = new JScrollPane(codeBlock27TextArea);
        codeBlock27ScrollPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        codeBlock27ScrollPane.setPreferredSize(new Dimension(300, 150));

        codeBlock27ScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(codeBlock27ScrollPane);

// Paragraph 28  HorizontalRule
        String horizontalRule28Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel horizontalRule28 = new JLabel(String.format(horizontalRule28Html, 400, ""));horizontalRule28.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        horizontalRule28.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(horizontalRule28);

// Paragraph 29  Heading
        String heading29Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading29Label = new JLabel(String.format(heading29Html, 420, "快速启动"));
        heading29Label.setFont(heading29Label.getFont().deriveFont(24.0f));heading29Label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        heading29Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading29Label);

// Paragraph 30  Heading
        String heading30Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading30Label = new JLabel(String.format(heading30Html, 420, "1. 编译与打包"));
        heading30Label.setFont(heading30Label.getFont().deriveFont(20.0f));heading30Label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        heading30Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading30Label);

// Paragraph 31  Paragraph
        JTextPane paragraph31 = new JTextPane();
        paragraph31.setContentType("text/html");
        paragraph31.setEditable(false);
        StyledDocument paragraph31Doc = paragraph31.getStyledDocument();
        paragraph31.setMargin(new Insets(10, 10, 10, 10));

        Style regular31 = paragraph31Doc.addStyle("regular", null);
        StyleConstants.setFontFamily(regular31, "SansSerif");

        try {
            paragraph31Doc.insertString(paragraph31Doc.getLength(), "使用 Maven 编译项目：", regular31);
        } catch (BadLocationException e) {
            e.printStackTrace();
        }

        paragraph31.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(paragraph31);

// Paragraph 32  Code
        JTextArea codeBlock32TextArea = new JTextArea("mvn clean compile  ");
        codeBlock32TextArea.setFont(new Font("Monospaced", Font.PLAIN, 12));
        codeBlock32TextArea.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        JScrollPane codeBlock32ScrollPane = new JScrollPane(codeBlock32TextArea);
        codeBlock32ScrollPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        codeBlock32ScrollPane.setPreferredSize(new Dimension(300, 80));

        codeBlock32ScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(codeBlock32ScrollPane);

// Paragraph 33  Heading
        String heading33Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading33Label = new JLabel(String.format(heading33Html, 420, "2. 运行项目"));
        heading33Label.setFont(heading33Label.getFont().deriveFont(20.0f));heading33Label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        heading33Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading33Label);

// Paragraph 34  Paragraph
        JTextPane paragraph34 = new JTextPane();
        paragraph34.setContentType("text/html");
        paragraph34.setEditable(false);
        StyledDocument paragraph34Doc = paragraph34.getStyledDocument();
        paragraph34.setMargin(new Insets(10, 10, 10, 10));

        Style regular34 = paragraph34Doc.addStyle("regular", null);
        StyleConstants.setFontFamily(regular34, "SansSerif");
        Style code34 = paragraph34Doc.addStyle("code", regular34);
        StyleConstants.setFontFamily(code34, "Monospaced");

        try {
            paragraph34Doc.insertString(paragraph34Doc.getLength(), "运行主类 ", regular34);
            paragraph34Doc.insertString(paragraph34Doc.getLength(), "FileTransferSwingApp", code34);
            paragraph34Doc.insertString(paragraph34Doc.getLength(), "，启动应用程序：", regular34);
        } catch (BadLocationException e) {
            e.printStackTrace();
        }

        paragraph34.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(paragraph34);

// Paragraph 35  Code
        JTextArea codeBlock35TextArea = new JTextArea("mvn exec:java Dexec.mainClass=\"org.filetransfer.gui.FileTransferSwingApp\" ");
        codeBlock35TextArea.setFont(new Font("Monospaced", Font.PLAIN, 12));
        codeBlock35TextArea.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        JScrollPane codeBlock35ScrollPane = new JScrollPane(codeBlock35TextArea);
        codeBlock35ScrollPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        codeBlock35ScrollPane.setPreferredSize(new Dimension(300, 80));

        codeBlock35ScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(codeBlock35ScrollPane);

// Paragraph 36  HorizontalRule
        String horizontalRule36Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel horizontalRule36 = new JLabel(String.format(horizontalRule36Html, 400, ""));horizontalRule36.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        horizontalRule36.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(horizontalRule36);

// Paragraph 37  Heading
        String heading37Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading37Label = new JLabel(String.format(heading37Html, 420, "项目结构"));
        heading37Label.setFont(heading37Label.getFont().deriveFont(24.0f));heading37Label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        heading37Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading37Label);

// Paragraph 38  Code
        JTextArea codeBlock38TextArea = new JTextArea("filetransferfrontend  \n├── src  \n│   ├── main  \n│   │   ├── java  \n│   │   │   └── org.filetransfer  \n│   │   │       ├── Main.java                     # 主启动类  \n│   │   │       ├── controller                    # 控制器类  \n│   │   │       ├── config                        # 配置类  \n│   │   │       ├── api                           # 后端 API 交互类  \n│   │   │       ├── utils                         # 工具类（如 JSON 解析）  \n│   │   │       └── view                          # 视图类（如主界面、上传面板）  \n│   │   ├── resources  \n│   │       └── icon                              # 图标资源\n├── pom.xml                                       # Maven 配置  \n└── README.md                                     # 项目文档  \n```  ");
        codeBlock38TextArea.setFont(new Font("Monospaced", Font.PLAIN, 12));
        codeBlock38TextArea.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        JScrollPane codeBlock38ScrollPane = new JScrollPane(codeBlock38TextArea);
        codeBlock38ScrollPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        codeBlock38ScrollPane.setPreferredSize(new Dimension(300, 300));

        codeBlock38ScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(codeBlock38ScrollPane);

// Paragraph 39  HorizontalRule
        String horizontalRule39Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel horizontalRule39 = new JLabel(String.format(horizontalRule39Html, 400, ""));horizontalRule39.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        horizontalRule39.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(horizontalRule39);

// Paragraph 40  Heading
        String heading40Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading40Label = new JLabel(String.format(heading40Html, 420, "主要模块说明"));
        heading40Label.setFont(heading40Label.getFont().deriveFont(24.0f));heading40Label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        heading40Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading40Label);

// Paragraph 41  List
        JPanel list41Panel = new JPanel();
        list41Panel.setLayout(new BoxLayout(list41Panel, BoxLayout.Y_AXIS));

        JLabel list41Label1 = new JLabel("1. 主界面 Main.java");
        list41Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list41Panel.add(list41Label1);
        JLabel list41Label2 = new JLabel("      提供应用程序的主窗口，包含文件上传、文件下载和留言管理的入口。");
        list41Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list41Panel.add(list41Label2);

        list41Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list41Panel);

// Paragraph 42  List
        JPanel list42Panel = new JPanel();
        list42Panel.setLayout(new BoxLayout(list42Panel, BoxLayout.Y_AXIS));

        JLabel list42Label1 = new JLabel("2. 控制器类 controller");
        list42Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list42Panel.add(list42Label1);
        JLabel list42Label2 = new JLabel("      选择文件并上传，显示文件验证码等反馈信息。");
        list42Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list42Panel.add(list42Label2);
        JLabel list42Label3 = new JLabel("      用户输入验证码下载文件，支持文件保存到本地。");
        list42Label3.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list42Panel.add(list42Label3);

        list42Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list42Panel);

// Paragraph 43  List
        JPanel list43Panel = new JPanel();
        list43Panel.setLayout(new BoxLayout(list43Panel, BoxLayout.Y_AXIS));

        JLabel list43Label1 = new JLabel("3. 配置类 config");
        list43Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list43Panel.add(list43Label1);
        JLabel list43Label2 = new JLabel("      配置文件路径、后端 API 地址等参数。");
        list43Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list43Panel.add(list43Label2);
        JLabel list43Label3 = new JLabel("      保存主题配置");
        list43Label3.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list43Panel.add(list43Label3);

        list43Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list43Panel);

// Paragraph 44  List
        JPanel list44Panel = new JPanel();
        list44Panel.setLayout(new BoxLayout(list44Panel, BoxLayout.Y_AXIS));

        JLabel list44Label1 = new JLabel("4. 后端交互服务 api");
        list44Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list44Panel.add(list44Label1);
        JLabel list44Label2 = new JLabel("      封装所有与后端的 HTTP 请求逻辑，包括文件上传、下载和留言管理。");
        list44Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list44Panel.add(list44Label2);

        list44Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list44Panel);

// Paragraph 45  HorizontalRule
        String horizontalRule45Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel horizontalRule45 = new JLabel(String.format(horizontalRule45Html, 400, ""));horizontalRule45.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        horizontalRule45.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(horizontalRule45);

// Paragraph 46  Heading
        String heading46Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading46Label = new JLabel(String.format(heading46Html, 420, "界面简介"));
        heading46Label.setFont(heading46Label.getFont().deriveFont(24.0f));heading46Label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        heading46Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading46Label);

// Paragraph 47  Heading
        String heading47Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading47Label = new JLabel(String.format(heading47Html, 420, "文件上传界面"));
        heading47Label.setFont(heading47Label.getFont().deriveFont(20.0f));heading47Label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        heading47Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading47Label);

// Paragraph 48  List
        JPanel list48Panel = new JPanel();
        list48Panel.setLayout(new BoxLayout(list48Panel, BoxLayout.Y_AXIS));

        JLabel list48Label1 = new JLabel("•  提供文件选择按钮、上传按钮、展示上传进度，上传成功后显示验证码。");
        list48Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list48Panel.add(list48Label1);

        list48Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list48Panel);

// Paragraph 49  Heading
        String heading49Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading49Label = new JLabel(String.format(heading49Html, 420, "文件下载界面"));
        heading49Label.setFont(heading49Label.getFont().deriveFont(20.0f));heading49Label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        heading49Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading49Label);

// Paragraph 50  List
        JPanel list50Panel = new JPanel();
        list50Panel.setLayout(new BoxLayout(list50Panel, BoxLayout.Y_AXIS));

        JLabel list50Label1 = new JLabel("•  输入验证码，点击下载按钮下载文件到本地，支持单个或者全部文件下载。");
        list50Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list50Panel.add(list50Label1);

        list50Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list50Panel);

// Paragraph 51  Heading
        String heading51Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading51Label = new JLabel(String.format(heading51Html, 420, "留言管理界面"));
        heading51Label.setFont(heading51Label.getFont().deriveFont(20.0f));heading51Label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        heading51Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading51Label);

// Paragraph 52  List
        JPanel list52Panel = new JPanel();
        list52Panel.setLayout(new BoxLayout(list52Panel, BoxLayout.Y_AXIS));

        JLabel list52Label1 = new JLabel("•  显示留言列表，支持添加留言。");
        list52Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list52Panel.add(list52Label1);

        list52Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list52Panel);

// Paragraph 53  Heading
        String heading53Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading53Label = new JLabel(String.format(heading53Html, 420, "文件统计界面"));
        heading53Label.setFont(heading53Label.getFont().deriveFont(20.0f));heading53Label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

        heading53Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading53Label);

// Paragraph 54  List
        JPanel list54Panel = new JPanel();
        list54Panel.setLayout(new BoxLayout(list54Panel, BoxLayout.Y_AXIS));

        JLabel list54Label1 = new JLabel("•  展示不同类型文件的上传下载数量。");
        list54Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list54Panel.add(list54Label1);

        list54Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list54Panel);

// Paragraph 55  HorizontalRule
        String horizontalRule55Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel horizontalRule55 = new JLabel(String.format(horizontalRule55Html, 400, ""));horizontalRule55.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        horizontalRule55.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(horizontalRule55);

// Paragraph 56  Heading
        String heading56Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading56Label = new JLabel(String.format(heading56Html, 420, "未来规划"));
        heading56Label.setFont(heading56Label.getFont().deriveFont(24.0f));heading56Label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        heading56Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading56Label);

// Paragraph 57  List
        JPanel list57Panel = new JPanel();
        list57Panel.setLayout(new BoxLayout(list57Panel, BoxLayout.Y_AXIS));

        JLabel list57Label1 = new JLabel(" 增强功能");
        list57Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list57Panel.add(list57Label1);
        JLabel list57Label2 = new JLabel("      支持用户登录认证和文件权限管理。");
        list57Label2.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list57Panel.add(list57Label2);
        JLabel list57Label3 = new JLabel("      添加本地文件历史记录功能。");
        list57Label3.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list57Panel.add(list57Label3);
        JLabel list57Label4 = new JLabel("      提供文件预览功能。");
        list57Label4.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list57Panel.add(list57Label4);
        JLabel list57Label5 = new JLabel("      支持文件加密和解密。");
        list57Label5.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list57Panel.add(list57Label5);
        JLabel list57Label6 = new JLabel("      增加文件搜索功能。");
        list57Label6.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list57Panel.add(list57Label6);

        list57Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list57Panel);

// Paragraph 58  Heading
        String heading58Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel heading58Label = new JLabel(String.format(heading58Html, 420, "参考文献"));
        heading58Label.setFont(heading58Label.getFont().deriveFont(24.0f));heading58Label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        heading58Label.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(heading58Label);

// Paragraph 59  List
        JPanel list59Panel = new JPanel();
        list59Panel.setLayout(new BoxLayout(list59Panel, BoxLayout.Y_AXIS));

        JLabel list59Label1 = new JLabel("•  [FlatLaf 官方文档](https://www.formdev.com/flatlaf/)");
        list59Label1.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 10));
        list59Panel.add(list59Label1);

        list59Panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(list59Panel);

// Paragraph 60  HorizontalRule
        String horizontalRule60Html = "<html><body style='width: %1spx'>%1s</body></html>";JLabel horizontalRule60 = new JLabel(String.format(horizontalRule60Html, 400, ""));horizontalRule60.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),        BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY)));

        horizontalRule60.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(horizontalRule60);

// Paragraph 61  Paragraph
        JTextPane paragraph61 = new JTextPane();
        paragraph61.setContentType("text/html");
        paragraph61.setEditable(false);
        StyledDocument paragraph61Doc = paragraph61.getStyledDocument();
        paragraph61.setMargin(new Insets(10, 10, 10, 10));

        Style regular61 = paragraph61Doc.addStyle("regular", null);
        StyleConstants.setFontFamily(regular61, "SansSerif");

        try {
            paragraph61Doc.insertString(paragraph61Doc.getLength(), "如有问题，请联系开发团队！ 🚀  ", regular61);
        } catch (BadLocationException e) {
            e.printStackTrace();
        }

        paragraph61.setAlignmentX(Component.LEFT_ALIGNMENT);
        mainPanel.add(paragraph61);
        return mainScrollPane;
    }
}
